package eventStrategies.physicalModel;

import model.IPhysicalDataModel;
import controller.IController;
import eventManager.AppEvent;
import eventStrategies.IEventResponse;
import events.ECodeEventList;
import events.physicalModel.GetSpinEnergyEvent;
import events.physicalModel.GetTemperatureEvent;
import events.physicalModel.ReplyGetSpinEnergyEvent;
import events.physicalModel.ReplyGetTemperatureEvent;

public class GetSpinEnergyStrategy extends IEventResponse {

	private IController controller;
	private IPhysicalDataModel physModel;
	
	public GetSpinEnergyStrategy(IController controller, IPhysicalDataModel physModel) {
		super(ECodeEventList.GET_SPINENERGY);
		this.controller = controller;
		this.physModel = physModel;
	}

	@Override
	public void execute(AppEvent event) {
		GetSpinEnergyEvent fullEvent = (GetSpinEnergyEvent) event;
		
		controller.processOutgoingEvent(new ReplyGetSpinEnergyEvent(fullEvent.sender, physModel.getSpinEnergy()));
		
	}
}
